package com.dhsc.service.impl.common;

import com.dhsc.domain.yypt.ResponseObject;
import com.dhsc.domain.yypt.sys.TXtdmVo;
import com.dhsc.exception.MyException;
import com.dhsc.local.dao.common.ICommonDao;
import com.dhsc.service.common.ICommonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: CommonServiceImpl
 * @Description: 网点异常记录信息
 * @Author: jwj
 * @Date: 2023/11/7 11:06
 */
@Service
@Slf4j
public class CommonServiceImpl implements ICommonService {
    @Autowired
    private ICommonDao commonDao;
    @Override
    public ResponseObject queryQsTXtdmByFldmStr(TXtdmVo x) {
        ResponseObject obj = new ResponseObject();
        try{
            List<TXtdmVo> list = commonDao.queryQsTXtdmByFldmStr(x);
            obj.setData(list);
            obj.setStatus(200);
        }catch(Exception e){
            log.error("查询字典信息出错", e);
            throw new MyException("查询字典信息出错",e);
        }
        return obj;
    }

    @Override
    public ResponseObject queryZhTXtdmByFldmStr(TXtdmVo x) {
        ResponseObject obj = new ResponseObject();
        try{
            List<TXtdmVo> list = commonDao.queryZhTXtdmByFldmStr(x);
            obj.setData(list);
            obj.setStatus(200);
        }catch(Exception e){
            log.error("查询字典信息出错", e);
            throw new MyException("查询字典信息出错",e);
        }
        return obj;
    }
}
